#pragma once
#include <string>
using namespace std;


class RTTI
{
public:
	RTTI( string name, RTTI* base = NULL);

	~RTTI(void){}

	string		getClassName(){ return m_className;}

	RTTI*		getBase(){ return m_baseClass;}

	bool		isType(RTTI* type){ return type == this;}

	bool		derived(RTTI* type);

private:
	 // Prevent copying
	RTTI(RTTI& rhs);
	RTTI& operator = ( RTTI& rhs);

	string		m_className;
	RTTI*		m_baseClass;
};


#define  RTTI_DECL\
	static  RTTI*	getRTTI() { return &rtti;}\
	static	RTTI	rtti;

#define  RTTI_IMPL(name, base)\
	RTTI	name::rtti(#name,base::getRTTI());

#define  RTTI_IMPL_NOPARENT(name)\
	RTTI	name::rtti(#name);

